    @Autowired
    private AccountContentService accountContentService;
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("api/getContext")
    public R getContext(String desc) {
        AccountContentEntity accountContentEntity = this.accountContentService.queryByDesc(desc,"1003");
        if (accountContentEntity == null) {
            return R.error("没有对应评论");
        }
        String content = accountContentEntity.getContent();
        String[] split = content.split("\\|");
        String jsonString = JSON.toJSONString(split);
        return R.ok().put("context", jsonString);
    }

    /**
     * 用于接收任务
     */
    @PostMapping("api/taskList")
    public R list(@RequestBody AccountUpEntity accountUpEntity){
        //TODO 自己封装请求json 不用ManagerTaskReqVo了

        ManagerTaskReqVo taskReqVo = new ManagerTaskReqVo();
        taskReqVo.setUrl(accountUpEntity.getLiveAddr());
        taskReqVo.setApiPinBiUrl("http://47.107.104.4:8080/renren-fast/admin/warmup/api/getContext?desc="+accountUpEntity.getCommentType());
        taskReqVo.setApiReplyUrl("http://47.107.104.4:8080/renren-fast/admin/managerwork/api/getContext?desc="+accountUpEntity.getCommentType());
        taskReqVo.setCommentType(accountUpEntity.getCommentType());
        taskReqVo.setCommentDelayStart(accountUpEntity.getCommentDelayStart());
        taskReqVo.setCommentDelayEnd(accountUpEntity.getCommentDelayEnd());
        taskReqVo.setCommentSendStart(accountUpEntity.getCommentSendStart());
        taskReqVo.setCommentSendEnd(accountUpEntity.getCommentSendEnd());
        taskReqVo.setAtRate(100);

        SendTaskVo map1 = new SendTaskVo(AccountUpEntity.OPTTYPE,taskReqVo);

//        MultiValueMap<String, Object> map1= new LinkedMultiValueMap<>();
//        map1.add("optType",AccountUpEntity.OPTTYPE);
//        map1.add("params",taskReqVo);
        String jsonString = JSON.toJSONString(map1);

        String url = "http://dou.shciyun.com/open/common/send/task";
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
        HttpMethod method = HttpMethod.POST;
        MultiValueMap<String, String> map= new LinkedMultiValueMap<>();

        // 封装数据
        map.add("data", jsonString);
        map.add("deviceId", accountUpEntity.getPhoneIds());
        map.add("type", "1");
        map.add("userId", "1");

        HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers);
        ResponseEntity<DevHttpJsonVo> response = this.restTemplate.exchange( url,method, request , DevHttpJsonVo.class );

        // 发送任务之后，保存任务到数据库
        accountUpService.save(accountUpEntity);

        return R.ok();
    }

    /**
     * 查询所有的评论描述
     */
    @RequestMapping("/commentType/list")
    public R queryDesc(){
        List<String> descs = this.accountContentService.queryDesc();
        return R.ok().put("list", descs);
    }

